package com.haois.mp.wechat.server;

import com.haois.mp.database.commom.enums.MpTypeEnum;
import com.haois.mp.database.module.common.service.IUserTokenService;
import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * Created by RuiHaoZ on 2018/3/24 23:22
 */
@Component("LogoutServer")
public class LogoutServerImpl extends AbstractMoreInfoServer {
    @Autowired
    protected IUserTokenService iUserTokenService;

    @Override
    public String execute(WxMpXmlMessage wxMpXmlMessage) {
        iUserTokenService.logout(wxMpXmlMessage.getFromUser(), MpTypeEnum.OFFACCOUNTS.getType(), "通过更多服务退出登录");
        return null;
    }
}
